package com.keyinong.qudan.tools;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
/***
 * 
 * @author luohao ���ߣ��޺�
 * @ʱ�䣺2016-7-12.����4:39:09
 * @������MyFragmentReplace.java
 * @���ܣ�fragment�л��ķ�װ��
 */
public class MyFragmentReplace {

	public static void fragmentReplace(FragmentActivity activity, int view,
			Fragment fragment) {
		FragmentManager fManager = activity.getSupportFragmentManager();
		FragmentTransaction transaction = fManager.beginTransaction();
		transaction.replace(view, fragment);
		transaction.commit();
	}

	public static void fragmentBundleReplace(FragmentActivity activity,
			int view, Bundle bundle, Fragment fragment) {
		FragmentManager fManager=activity.getSupportFragmentManager();
		FragmentTransaction transaction=fManager.beginTransaction();
		fragment.setArguments(bundle);
		transaction.replace(view, fragment);
		transaction.commit();

	}

}
